package cn.edu.ctbu.demo1.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.domain.Page;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *  针对tb_student1的实体类
 */
//取对象命一般小写
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "tb_student1")
public class Student {
    /**
     * 编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
     * 学号
     */
    @NotNull
    @Size(min = 10,max = 10,message="学号必须为10个字符")
    private String no;

    /**
     * 姓名
     */
    @NotNull
    private String name;

    /**
     * 性别，男，女
     */
    private String sex;

    /**
     * 班级
     */
    private String classname;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 成绩
     */
    private Integer score;

    /**
     * 密码
     */
    private String password;
}
